<?php

namespace TableTennis\LicenseeBundle\Entity;

use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity(repositoryClass="TableTennis\LicenseeBundle\Repository\LicenseeRepository")
 * @ORM\Table(name="licensee")
 */
class Licensee {

    /**
     * @ORM\Id
     * @ORM\Column(type="integer", nullable=false)
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var User
     *
     * @ORM\ManyToOne(targetEntity="Application\Sonata\UserBundle\Entity\User")
     * @ORM\JoinColumn(name="licensee_user_id", referencedColumnName="id")
     */
    public $licensee_user_id;

    /**
     * @ORM\Column(type="integer", length=4)
     */
    public $licensee_number;

    /**
     * @ORM\Column(type="string", length=64)
     * @Assert\NotBlank
     * @Assert\MinLength(3)
     */
    public $lastname;

    /**
     * @ORM\Column(type="string", length=64)
     * @Assert\NotBlank
     * @Assert\MinLength(3)
     */
    public $firstname;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    public $ranking;

    /**
     * @ORM\Column(type="decimal", length=3, scale="2", nullable=true)
     */
    public $nb_current_points;

    /**
     * @ORM\Column(type="decimal", length=3, scale="2", nullable=true)
     */
    public $monthly_increase;

    /**
     * @ORM\Column(type="string",length="2", columnDefinition="ENUM('P', 'B1', 'B2', 'M1', 'M2', 'C1', 'C2', 'J1', 'J2', 'J3', 'S', 'V1', 'V2', 'V3', 'V4')")
     * @Assert\NotBlank()
     */
    public $category;

    /**
     * @ORM\Column(type="string",length="4", columnDefinition="ENUM('play', 'rest')")
     */
    public $status;

     /**
     * @var Team
     *
     * @ORM\ManyToOne(targetEntity="TableTennis\TeamBundle\Entity\Team")
     * @ORM\JoinColumn(name="team_id", referencedColumnName="id")
     */
    public $team_id;

     /**
     * @var Club
     *
     * @ORM\ManyToOne(targetEntity="TableTennis\ClubBundle\Entity\Club")
     * @ORM\JoinColumn(name="club_id", referencedColumnName="id")
     */
    public $club_id;

    /**
     * @var datetime $created
     *
     * @ORM\Column(name="created_at", type="datetime")
     * @Gedmo\Timestampable(on="create")
     */
    private $createdAt;

    /**
     * @var datetime $updated
     *
     * @ORM\Column(name="updated_at", type="datetime")
     * @Gedmo\Timestampable(on="update")
     */
    private $updatedAt;

    /**
     * @Gedmo\Slug(fields={"lastname", "firstname"})
     * @ORM\Column(length=128, unique=true)
     */
    private $slug;

    /**
     * Set id
     *
     * @param integer
     */
    public function setId($id)
    {
        $this->id = $id;
    }
    
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set licensee_number
     *
     * @param integer $licenseeNumber
     */
    public function setLicenseeNumber($licenseeNumber)
    {
        $this->licensee_number = $licenseeNumber;
    }

    /**
     * Get licensee_number
     *
     * @return integer 
     */
    public function getLicenseeNumber()
    {
        return $this->licensee_number;
    }

    /**
     * Set lastname
     *
     * @param string $lastname
     */
    public function setLastname($lastname)
    {
        $this->lastname = $lastname;
    }

    /**
     * Get lastname
     *
     * @return string 
     */
    public function getLastname()
    {
        return $this->lastname;
    }

    /**
     * Set firstname
     *
     * @param string $firstname
     */
    public function setFirstname($firstname)
    {
        $this->firstname = $firstname;
    }

    /**
     * Get firstname
     *
     * @return string 
     */
    public function getFirstname()
    {
        return $this->firstname;
    }

    /**
     * Set ranking
     *
     * @param integer
     */
    public function setRanking($ranking)
    {
        $this->ranking = $ranking;
    }

    /**
     * Get ranking
     *
     * @return integer
     */
    public function getRanking()
    {
        return $this->ranking;
    }

    /**
     * Set nb_current_points
     *
     * @param decimal $nbCurrentPoints
     */
    public function setNbCurrentPoints($nbCurrentPoints)
    {
        $this->nb_current_points = $nbCurrentPoints;
    }

    /**
     * Get nb_current_points
     *
     * @return decimal
     */
    public function getNbCurrentPoints()
    {
        return $this->nb_current_points;
    }

    /**
     * Set monthly_increase
     *
     * @param decimal $monthly_increase
     */
    public function setMonthlyIncrease($monthly_increase)
    {
        $this->monthly_increase = $monthly_increase;
    }

    /**
     * Get monthly_increase
     *
     * @return decimal
     */
    public function getMonthlyIncrease()
    {
        return $this->monthly_increase;
    }

    /**
     * Set category
     *
     * @param string $category
     */
    public function setCategory($category)
    {
        $this->category = $category;
    }

    /**
     * Get category
     *
     * @return string 
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * Set status
     *
     * @param string $status
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }

    /**
     * Get status
     *
     * @return string 
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set createdAt
     *
     * @param datetime $createdAt
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;
    }

    /**
     * Get createdAt
     *
     * @return datetime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set updatedAt
     *
     * @param datetime $updatedAt
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;
    }

    /**
     * Get updatedAt
     *
     * @return datetime 
     */
    public function getUpdatedAt()
    {
        return $this->updatedAt;
    }

    /**
     * Set slug
     *
     * @param string $slug
     */
    public function setSlug($slug)
    {
        $this->slug = $slug;
    }

    /**
     * Get slug
     *
     * @return string 
     */
    public function getSlug()
    {
        return $this->slug;
    }

    /**
     * Set licensee_user_id
     *
     * @param Application\Sonata\UserBundle\Entity\User $licenseeUserId
     */
    public function setLicenseeUserId(\Application\Sonata\UserBundle\Entity\User $licenseeUserId)
    {
        $this->licensee_user_id = $licenseeUserId;
    }

    /**
     * Get licensee_user_id
     *
     * @return Application\Sonata\UserBundle\Entity\User 
     */
    public function getLicenseeUserId()
    {
        return $this->licensee_user_id;
    }

    /**
     * Set team_id
     *
     * @param TableTennis\TeamBundle\Entity\Team $teamId
     */
    public function setTeamId(\TableTennis\TeamBundle\Entity\Team $teamId)
    {
        $this->team_id = $teamId;
    }

    /**
     * Get team_id
     *
     * @return TableTennis\TeamBundle\Entity\Team 
     */
    public function getTeamId()
    {
        return $this->team_id;
    }

    /**
     * Set club_id
     *
     * @param TableTennis\ClubBundle\Entity\Club $clubId
     */
    public function setClubId(\TableTennis\ClubBundle\Entity\Club $clubId)
    {
        $this->club_id = $clubId;
    }

    /**
     * Get club_id
     *
     * @return TableTennis\ClubBundle\Entity\Club 
     */
    public function getClubId()
    {
        return $this->club_id;
    }


    public function __toString()
    {
        return $this->lastname . " " . $this->firstname;
    }
}